﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetDiskPRJ.DBUtility;
using System.Data;

namespace NetDiskPRJ.DAL
{
    public class PrvAllowData
    {
        public PrvAllowData()
        {
 
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public NetDiskPRJ.Model.PrvAllowData DataRowToModel(DataRow row)
        {
            NetDiskPRJ.Model.PrvAllowData model = new NetDiskPRJ.Model.PrvAllowData();
            if (row != null)
            {
                if (row["FTaxUnitCd"] != null)
                {
                    model.FTaxUnitCd = row["FTaxUnitCd"].ToString();
                }
                if (row["FLogID"] != null)
                {
                    model.FLogID = row["FLogID"].ToString();
                }

                if (row.Table.Columns.Contains("FDisctrictName"))
                {
                    if (row["FDisctrictName"] != null)
                    {
                        model.FDisctrictName = row["FDisctrictName"].ToString();
                    }
                }
                
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select FTaxUnitCd,FLogID ");
            strSql.Append(" FROM t_PrvAllowData ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperSQL.Query(strSql.ToString());
        }
    }
}
